<div id="network-gauge1" style="height: 100%">

</div>
<script type="text/javascript">
    $(function () {
        $.ajax({
            url: "#springUrl('/network/bar1.html')",
            data: {"batchId": "$!{batchId}"},
            type: "POST",
            success: function (text) {
                var d = JSON.parse(text);
                if (d.success && d.data) {
                    var ratio = ((d.data.value[0] - d.data.value[1]) * 100 / d.data.value[0]).toFixed(2);
                    var myChart = echarts.init(document.getElementById('network-gauge1'), 'macarons');
                    var option = {
                        title: {
                            text: '成本降低',
                            show: false
                        },
                        tooltip: {
                            formatter: "{a} <br/>{b} : {c}%"
                        },
                        series: [
                            {
                                name: '成本降低',
                                type: 'gauge',
                                detail: {formatter: '{value}%'},
                                data: Math.abs(ratio),
                                textStyle: {
                                    color: '#fff'
                                }
                            }
                        ]
                    };
                    myChart.setOption(option);
                }
            }
        });
    });
</script>